package com.lnsystem.dao.impl;

import java.util.List;
import java.io.Serializable;
import java.util.List;

import javax.transaction.Transactional;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.springframework.beans.factory.annotation.Autowired;

import com.lnsystem.dao.StockDao;
import com.lnsystem.model.Stock;


public class StockDaoHibernateImpl implements StockDao {



	 @Autowired
	 SessionFactory sessionFactory;


	public List<Stock> getAllSymbols() {
	  Session session = sessionFactory.openSession();
	  @SuppressWarnings("unchecked")
	  List<Stock> stockList = session.createQuery("from Stock")
	    .list();
	  session.close();
	  return stockList;
	 }

	
	
}
